package com.wy.feignclient;

import com.wy.config.FeignConfig;
import com.wy.pojo.Course;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * @author wuyue
 * @date 2020/1/10 9:36
 */
@FeignClient(value = "user-service",fallback = CourseFallBack.class,configuration = FeignConfig.class) //user-service等同于127.0.0.1：9090   fallback指定当前类
public interface CourseClient {

    @GetMapping("/course/{name}")
     public List<Course> findByName(@PathVariable String name);
}

